import platform = require('../../../../platform/common/baseCommon');
import bpServer = require('../../../../platform/server/bpServer');
import taxLoanServer =require('../../../../product/taxLoan/server/taxLoanServer');
import tpServer = require('../../../../platform/server/smsplatformService');
import appServer = require('../../../../platform/server/appServer');
import example = require('./serviceConfig');
import webptService = require('./webptDataServiceConfig');
import dbconnectexample = require('./thirdServiceConfig');
import path = require('path');
// 启动应用
export let app = new appServer.serverApplication();

app.port = 3000;

//配置https
app.httpsConfig = new appServer.httpsConfig();
app.httpsConfig.port = 3001;
app.httpsConfig.privateKeyPath = './ssl/server.key';
app.httpsConfig.certificatePath = "./ssl/server.crt";
app.httpsConfig.codogram = 'utf-8';

let nsrxxService =new taxLoanServer.UserextendService();//纳税人信息服务
let userLoginService = new bpServer.UserLoginService();//登录服务
// let sendcodeService= new tpServer.yunpianService();//发送验证码真实服务
let sendcodeService= new tpServer.smlyunpianService();//发送验证码模拟服务
userLoginService.featureController=new appServer.serviceFeatureController();
// userLoginService.featureController.features = [
//     {
//         owner: 'sysadmin',
//         ownerType: 'role',
//         content: 'logout',
//         effect: 'grant',
//         targetType: 'ServiceMethod'
//     }
// ];
app.services = [
    {
        serviceName: 'databaseLogService',  // 数据库日志服务
        serviceObject: new appServer.databaseLogger()
    },
    {
        serviceName: 'fileLogService',      // 文件日志服务
        serviceObject: new appServer.fileLogger()
    },
    {
        serviceName: 'loginService',//登录服务
        serviceObject: userLoginService
    },
    {
        serviceName: 'getcodeService',//获取验证码服务
        serviceObject: sendcodeService
    },
    {
        serviceName: 'nsrxxService',//获取验证码服务
        serviceObject: nsrxxService
    },
    example.dataServiceInfo,
    webptService.dataServiceInfo,
    dbconnectexample.dataServiceInfo,
];

app.serverLogger = new appServer.databaseLogger();
